############################################################################
##

include ../common/Makefile.common

## Process this file with automake to generate Makefile.in.

if BUILD_WITH_MSVC
noinst_LIBRARIES = viewers.lst
else
noinst_LTLIBRARIES = libSoQtViewers.la
endif

## Remove any linklibraries detected by configure, as they are not
## needed in the submodules -- only in the toplevel libSoQt build.

DEFAULT_INCLUDES = -I$(top_builddir)/src -I$(top_srcdir)/src

LIBS = 

############################################################################
## Autogenerated source files (some by the Qt moc utility; necessary to get
## the Qt signal-slot mechanisms working).

BUILT_SOURCES = \
	$(SoGuiAllBuiltFiles)

CLEANFILES = \
	$(SoGui_src_Inventor_Gui_viewers_BuiltMetaFiles)

DISTCLEANFILES = \
	$(SoGui_src_Inventor_Gui_viewers_BuiltFiles) \
	$(SoGui_src_Inventor_Gui_viewers_BuiltMetaFiles)

############################################################################
# libtool setup

RegularSources = \
	FullViewer.cpp \
	So@Gui@FullViewerP.h \
	ExaminerViewer.cpp \
	So@Gui@ExaminerViewerP.h \
	PlaneViewer.cpp \
	So@Gui@PlaneViewerP.h
BuiltSources = \
	$(SoGui_src_Inventor_Gui_viewers_BuiltFiles)

LinkHackSources = \
	all-viewers-cpp.cpp


if HACKING_COMPACT_BUILD
BuildSources = $(LinkHackSources)
NoDistSources =
ExtraSources = $(RegularSources)
else
BuildSources = $(RegularSources)
NoDistSources = $(BuiltSources)
ExtraSources = $(LinkHackSources)
endif

libSoQtViewers_la_SOURCES = \
	$(BuildSources)

nodist_libSoQtViewers_la_SOURCES = \
	$(NoDistSources)

############################################################################
# custom setup

viewers_lst_SOURCES = \
	$(BuildSources)

nodist_viewers_lst_SOURCES = \
	$(NoDistSources)

viewers.lst: Makefile $(viewers_lst_OBJECTS)
	@echo "Linking $@..."; \
	rm -f $@; \
	for i in $(viewers_lst_OBJECTS); do echo $$i >>$@; done

############################################################################
# header installation

if MAC_FRAMEWORK
SoQtViewersincdir = $(MAC_FRAMEWORK_PREFIX)/$(MAC_FRAMEWORK_NAME).framework/Versions/$(MAC_FRAMEWORK_VERSION)/Headers/viewers
else
SoQtViewersincdir = $(includedir)/Inventor/@Gui@/viewers
endif
SoQtViewersinc_HEADERS =

nodist_SoQtViewersinc_HEADERS = \
	SoQtViewer.h \
	SoQtFullViewer.h \
	SoQtExaminerViewer.h \
	SoQtPlaneViewer.h \
	SoQtConstrainedViewer.h \
	SoQtFlyViewer.h

install-SoQtViewersincHEADERS: $(SoQtViewersinc_HEADERS)
	@$(NORMAL_INSTALL)
	$(mkinstalldirs) $(DESTDIR)$(SoQtViewersincdir)
	@list='$(SoQtViewersinc_HEADERS)'; for p in $$list; do \
	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
	  f="`echo $$p | sed -e 's|^.*/||'`"; \
	  src="$$d$$p"; dst="$(DESTDIR)$(SoQtViewersincdir)/$$f"; \
	  if cmp -s "$$src" "$$dst"; then :; else \
	    echo " $(INSTALL_HEADER) $$src $$dst"; \
	    $(INSTALL_HEADER) "$$src" "$$dst" || exit 1; \
	  fi; \
	done

install-nodist_SoQtViewersincHEADERS: $(nodist_SoQtViewersinc_HEADERS)
	@$(NORMAL_INSTALL)
	$(mkinstalldirs) $(DESTDIR)$(SoQtViewersincdir)
	@list='$(nodist_SoQtViewersinc_HEADERS)'; for p in $$list; do \
	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
	  f="`echo $$p | sed -e 's|^.*/||'`"; \
	  src="$$d$$p"; dst="$(DESTDIR)$(SoQtViewersincdir)/$$f"; \
	  if cmp -s "$$src" "$$dst"; then :; else \
	    echo " $(INSTALL_HEADER) $$src $$dst"; \
	    $(INSTALL_HEADER) "$$src" "$$dst" || exit 1; \
	  fi; \
	done

# EOF ######################################################################
